//
//  SeeImgCollectionViewCell.m
//  BusineseStore
//
//  Created by 闪风猫 on 2017/11/13.
//  Copyright © 2017年 TNG. All rights reserved.
//

#import "SeeImgCollectionViewCell.h"

@implementation SeeImgCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor blackColor];
        self.img=[[UIImageView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
        self.img.contentMode=UIViewContentModeScaleAspectFit;
        self.img.userInteractionEnabled =YES;
//        [self.img addGestureRecognizer:[[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(pin:)]];
//        UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tap:)];
//        tap.numberOfTapsRequired = 2;
//        [self.img addGestureRecognizer:tap];
        [self.contentView addSubview:self.img];
    }
    return self;
}

-(void)pin:(UIPinchGestureRecognizer *)pinch
{
    if (pinch.scale > 1.2) {
         pinch.view.transform = CGAffineTransformMakeScale(1.2, 1.2);
    }else if (pinch.scale > 0.8)
    {
         pinch.view.transform = CGAffineTransformMakeScale(pinch.scale, pinch.scale);
    }else
    {
        pinch.view.transform = CGAffineTransformMakeScale(0.8, 0.8);
    }
}

-(void)tap:(UITapGestureRecognizer *)tap{
    tap.view.transform = CGAffineTransformMakeScale(1, 1);
}

@end
